High energy electron diffraction instrument with tunable camera length

Ultrafast electron diffraction (UED) stands as a powerful technique for real-time observation of structural dynamics at the atomic level. In recent years, the use of MeV electrons from radio frequency guns has been widely adopted to take advantage of the relativistic suppression of the space charge effects that otherwise limit the temporal resolution of the technique. Nevertheless, there is not a clear choice for the optimal energy for a UED instrument. Scaling to beam energies higher than a few MeV does pose significant technical challenges, mainly related to the inherent increase in diffraction camera length associated with the smaller Bragg angles. In this study, we report a solution by using a compact post-sample magnetic optical system to magnify the diffraction pattern from a crystal Au sample illuminated by an 8.2 MeV electron beam. Our method employs, as one of the lenses of the optical system, a triplet of compact, high field gradients (>500 T/m), small-gap (3.5 mm) Halbach permanent magnet quadrupoles. Shifting the relative position of the quadrupoles, we demonstrate tuning the magnification by more than a factor of two, a 6× improvement in camera length, and reciprocal space resolution better than 0.1 Å−1 in agreement with beam transport simulations.


I. INTRODUCTION
Ultrafast electron diffraction (UED) enables following the dynamical evolution of matter at fundamental atomic spatial and temporal scales.2][13] Further introduction of methods from accelerator physics in recent years such as radio frequency (RF) compression, 14 advanced cathodes, 15 phase space manipulations, 16,17 and better detectors 18,19 have all contributed to the significant improvements in the performance of modern UED instruments.
An area of focus for advancement involves the evolution of magnetic optics for UED.Upstream of the sample, strong lenses can be used to focus a high brightness electron beam to sub-micron spot sizes to investigate the dynamics of very small or heterogeneous samples. 20,21After the sample, preliminary experiments have shown that the use of a magnetic lens can improve the reciprocal space resolution. 22,23However, most beamlines still utilize a propagation drift to convert the scattering angles into a spatial offset at the detector.
Post-sample magnetic optics would also allow to greatly extend the energy of UED instrumentation.Relativistic UED beamlines have been limited to kinetic energies <4 MeV for many practical reasons such as the available RF power and accelerating gradient in the RF gun.Another important limitation comes from the fact that due to the reduction in scattering angles, higher energies necessitate longer drifts to separate the scattered electrons from the main beam on the detector screen.At the same time, it has been pointed out that the diffraction contrast from the relative coherence length (i.e., the ratio between the electron wavelength and the beam intrinsic divergence) does not suffer from increasing the beam energy. 3This occurs since geometric emittance and De Broglie wavelength scale inversely with the normalized beam longitudinal momentum bc.A higher beam energy in UED carries several other advantages.The flatter Ewald sphere resulting from the shorter wavelength of the scattering wave brings strong sensitivity to very high orders in the diffraction pattern.For gas phase, the contribution of velocity mismatch is further suppressed as the deviation from the speed of light scales as c À2 .Most importantly, higher beam energies are associated with higher penetration depth.The capability to go through thicker samples could significantly enhance the range of experiments accessible to UED, paving the way to liquid cells, shock dynamics and diffuse scattering studies.Finally, at the cost of increased complexity, beamlines at higher electron energy can pack more electrons in tighter spots and shorter bunch lengths due to the substantial c dependence in space charge effects.
In this paper, we investigate, with the help of simulations and in a proof-of-principle experiment carried out at the UCLA Pegasus beamline, 24 the addition of post-sample optics to push the energy in UED instrumentation to 8 MeV (nearly twice the previous state-of-the-art 3 ).To do this, we implement a two-lens telescope where one of the optics is a strong permanent magnet-based quadrupole (PMQ) triplet to restore the diffraction contrast and maximize the angular magnification on a screen located 1 m from the sample.Controlling the relative position of the PMQs allows for the demonstration of tunable diffraction camera length and improvement of the reciprocal space resolution.In principle, round solenoidal lenses could be used for this task.Still, short focal length at >5 MeV electron energies can only be achieved using extraordinarily high magnetic fields and bulky and/or superconducting coils. 25By replacing solenoids with quadrupole triplets, we separate the horizontal and vertical optical degrees of freedom and add a layer of complexity in optimization and alignment but greatly simplify the system in terms of cost and size.
We will start the discussion by reviewing the quadrupole optimization strategy informed by a preliminary thin lens system description.Details are then provided on experimental techniques for aligning the PMQ triplet to a level sufficient to achieve the required optical focusing with minimal steering effects on the beam.Finally, experimental results using the high brightness beam from the Pegasus beamline demonstrate tunable magnification of the diffraction pattern from a crystalline gold sample at 8.2 MeV in a 1 m distance.Interestingly, we can assess the imaging performance of the quadrupole triplets employed in the experiment by studying the diffraction pattern distortions as the alignment through the optical system is varied.Once evaluated, the aberrations can be cross-referenced with 3D magnetostatic simulations, enabling the identification of the underlying factors contributing to the quality of the lenses.

II. THIN LENS OPTICS DESCRIPTION AND NUMERICAL OPTIMIZATION OF QUADRUPOLE OPTICS A. Thin lens description of angular magnification
The magnification of the optical system after the UED sample can be easily understood using thin lens transport matrices.Consider two stages; the first is an objective lens, with focal length f o , followed by a drift distance equal to its focal length, which transports to the back focal plane.The second is an eyepiece lens, with focal length f e , which images the back focal plane of the objective lens to a downstream detector plane with magnification m.The matrix transport relating initial coordinates ðx 0 ; x 0 0 Þ to the final coordinates ðx f ; x 0 f Þ is given by where m 0 is the axial derivative of m at the image plane. 26A ray diagram of this transport is shown in Fig. 1.
If the eyepiece lens is imaging over a total distance L, the object and image distances p and q can be expressed in terms of L and f e as , respectively.For a strong eyepiece lens (i.e., f e ( L), we can approximate the magnification m % ÀL=f e .In this case, the relationship between the final position on the detector screen and the initial diffraction angle can be written as clearly showing how a tunable diffraction camera can be obtained by adjusting the focal lengths for the eyepiece and objective in the angular magnification telescope.

B. Quadrupole optics
In implementing the scheme, we use two quadrupole triplets as objective and eyepiece, respectively.For the eyepiece, where it is essential to use as strong of a lens as possible to maximize the magnification in a given distance, we take advantage of high gradient permanent magnet quadrupole (PMQ) lenses, which have been shown to have a focal length of few cms at MeV electron energy. 27An additional benefit of using quadrupole-based lenses, which results from the independent evolution of the rays in the horizontal and vertical planes, is that the scheme offers a wide range of imaging solutions with different magnifications, all accessible with relatively small translations of the elements within the eyepiece triplet, which is critical given the lack of tunability of the PMQ gradients.
The optimization of the strengths of the quadrupoles in the objective lens and the eyepiece PMQ positions is based on a matrix representation of the transport from the sample to the detector.The focusing matrices include an approximation for the quadrupole fringe fields where an Enge function fits the gradient for each quad as where l is the effective length of the quadrupole, b is the steepness parameter of the edges, approximately half the quadrupole gap radius, and G 0 is the nominal peak magnetic field gradient. 28n the paraxial approximation, the linearized transverse equations of motion are given by (4) where primes are derivatives with respect to the propagation distance z, the focusing strength jðzÞ ¼ GðzÞ ½Bq , and ½Bq ¼ p=e is axial momentum normalized by the electron charge. 29In contrast, the focusing strength for a round solenoid is inversely proportional to the square of ½Bq.
The general solution to the ray equation is of the form where the functions C x ; C y ; S x , and S y are the transport cosine and sine-like trajectories (also known as principal rays), the principal planes of the quadrupole optics are defined by where these functions are zero; for example, a focal plane is where C ¼ 0 and an imaging plane occurs whenever S ¼ 0 (where a subscript of x or y is implied).The ideal optical functions for diffraction are C ¼ 0 and S as large as possible to maximize the reciprocal space resolution.

C. The role of post-sample optics in improving diffraction resolution
To estimate the effect of the magnification on the reciprocal space resolution of a diffraction pattern, it is useful to define a diffraction contrast ratio, R ¼ r=q, which is the RMS size of the beam, r, at the detector, divided by q, which is the distance separating a Bragg peak from the direct beam.The Bragg separation q is related to the Bragg angle, denoted by h B , and angular magnification, denoted as S, through the equation q ¼ Sh B .Since h B depends on the particular reciprocal space plane we are looking at, the diffraction contrast ratio can be normalized by the lattice periodicity to obtain the momentum transfer or q-resolution where k is the De Broglie wavelength of the electrons illuminating the sample.
Assuming the transverse phase space of the beam at the sample plane is uncorrelated (in general, the correlation is very small for nearly parallel beam illumination, and adding it does not change the conclusion of this section), the width of a Bragg peak, as measured on the detector, is related to the initial conditions of the beam at the sample plane by where r 0 and r h are the initial RMS spot size and angular divergence of the beam at the sample, respectively, and PSF is the point spread function of the screen.Inserting this expression into the relative q-resolution, we obtain When there are no post-sample optics, S is just the drift length and C ¼ 1 and the best choice to improve the resolution is to increase the drift length from the sample to the detector to minimize the two contributions in the quadrature sum that multiply r h =k.Note that for high energy beams the intrinsic beam divergence scales as bc À1 , and longer distances are needed to approach this ideal resolution.
The benefit of using post-sample optics is that we can arrange it to have C ¼ 0 at the detector plane and then, for higher beam energies, greatly increase the angular magnification S to minimize the contribution from the PSF as illustrated in Fig. 2. The figure shows how adding an objective triplet (b) sharpens the diffraction pattern (essentially by zeroing C), and adding the PMQ eyepiece (c) magnifies the pattern by increasing S and spreading out the Bragg peaks.

D. Momentum mapping conditions
The matrix representation for the linear optical transport was first used to numerically optimize the quadrupole gradients/currents and PMQ spacings to obtain equal magnifications at the detector plane.The parameters from the linear optimization were then used in start-to-end GPT simulations, which utilized actual 3D field maps from the quadrupoles from magnetostatic simulations.The results were found in excellent agreement with the idealized fringe field matrix model.
In Figs.3(a) and 3(b), we show such an optimized set of solutions for the cosine-like and sine-like trajectories, plotting the principal rays obtained from the matrix transport.In Fig. 3(a), note the axis is unitless in accordance with Eqs. ( 6) and (7).In this optimization, the positions of the back focal planes are placed symmetrically just in front of the eyepiece, which is 0.8 m downstream of the sample position (which defines z ¼ 0 in this plot) while the detector screen is at z ¼ 1.6 m.In FIG. 2. Cartoon depicting the angular magnification telescope concept implemented using two quadrupole triplets as applied to the Pegasus UED beamline.
the optimization, the currents in the objective triplet are limited to avoid overheating and magnetic field saturation in the yoke.Similarly, we restrict the range of possible spacings of the PMQs since they are mounted on a flexure-based stage that can provide only mm-range adjustability.
At the final screen, the system can achieve S ¼ À20 m, more than one order of magnitude larger than what would be achieved without post-sample optics.In fact, at this plane, the magnification would be so large that a very large detector screen would be needed to capture most of the diffraction peaks (i.e., a Bragg angle of 0.5 mrad would translate in an offset of 1 cm).For this reason, the experiment was conducted at the nearby screen located at z ¼ 1.02 m from the sample where lower magnification factors could be obtained so that multiple Bragg peaks could fit on the detector screen.
There are two ways to tune the magnification for a fixed distance from the sample to the detector.In one case, we can vary the quad currents so that both back focal planes of the green triplet objective lens occur at the same longitudinal position scanned longitudinally along with the PMQ triplet.The results at the nearby screen are shown in Fig. 3(c) where n is the position of the objective back focal planes.For each solution, the eyepiece is optimized to image onto the detector, yielding a tunable overall angular magnification at the z ¼ 1.02 m mark.This approach requires the PMQ stage to move over a long range, which is not feasible to install in the beamline vacuum.
Alternatively, we can leave the PMQ triplet central position fixed and utilize the variability of spacings between PMQs to image asymmetric objective back focal planes with equal magnifications onto the detector.Results of this strategy are shown in Fig. 3(d).The parameter d represents the separation of the two objective lens back focal planes about a fixed n ¼ 0.75 m position; then, the eyepiece spacings are solved to restore symmetric angular magnification.

III. PMQ TRIPLET SETUP AND ITS ALIGNMENT
Each PMQ is a 16-sector Halbach-style array featuring an inner diameter of 3.5 mm and an outer diameter of 7 mm. 27They are formed using wire electrical discharge machined N35SH NbFeB.The PMQ triplet is positioned on a flexure-based mounting stage, which keeps the central quad fixed in position with respect to the stage, but allows for the capability to fine-tune both upstream and downstream PMQ spacings [refer to Fig. 4(a)].Theoretically, this design allows us to achieve optimal imaging conditions by precisely adjusting the longitudinal distances between the quadrupoles.
The peak gradients and effective lengths of the assembly were initially derived from Radia 30 simulations and subsequently reevaluated using Hall probe measurements on the manufactured PMQs.The PMQs' gradients consistently align with values documented in earlier research which originally used the same triplet as this study. 27The most recent measurements of PMQs' magnet parameters are reported in Table I.
Achieving the specified imaging condition required precise prealignment of the PMQ triplet on the stage.In the setup, the mounts for the upstream and downstream PMQs have horizontal and vertical fine adjustment micrometers.A pulsed-wire method 31,32 was employed to ensure the relative alignment of the elements in the triplet.
The technique is illustrated in Fig. 4(b) and works as follows.A beryllium-enhanced copper wire, measuring 50 lm in diameter, is threaded through the aperture of the PMQ triplet and carefully tightened.Subsequently, a pulse generator transmits a square-wave electric signal through the wire.Owing to the magnetic fields of the PMQs, the wire experiences a kick, the strength of which is proportional to its displacement from the physical center of the PMQs.The kick travels through the wire and is detected by a laser-photodiode system which translates the wire displacement into a voltage signal that can be recorded on a scope.
When a long 1 ms current pulse is employed, the photodiode trace conveniently represents the second integral of the field, i.e., the trajectory of the electrons.Varying the position of the PMQ holders yields a linear relationship between the peak signal height of the kick and the PMQ position (as expected, the field grows linearly when going off-axis).Therefore, the PMQs can be aligned by flattening the signal trace.The accuracy level of the pulsed-wire method is determined by the photodiode conversion gain, string tension, power supply jitter, and ultimately by the oscilloscope readout error.In Fig. 5(a), we can see a linear correlation between signal height and actual offset of PMQs.Given the oscilloscope readout jitter of 5 mV after averaging over 128 data points, we estimate the alignment accuracy obtained with this method to be less than 25 lm.Following static alignment, we conduct tests to verify that the alignment is preserved when axially   When utilizing shorter pulses, the signals arise from the effective velocity kick in the PMQ fields (i.e., first integral).The output signal for different transverse offset is shown in Fig. 5(c).The traces can be numerically derived to retrieve the actual field profiles for different wire positions.Figure 5(d) shows the result of the fields retrieved from the photodiode traces using a 10ls pulse.As expected, the peak field changes sign and increases in magnitude depending on the offset of the wire from the alignment axis.Upon further inspection, it is found that the peak fields change linearly with transverse offset in the quadrupoles.

IV. EXPERIMENTAL RUN
The experiment was performed at the UCLA Pegasus Laboratory, which is a high brightness beamline based on a high gradient 1.6 cell S-band RF photo-injector gun. 33A top-down view of the PEGASUS experimental setup is shown to scale in Fig. 6.The photo-injector is operated with low charge of 0.5 pC per bunch as measured by an integrated current transformer (ICT) located at the gun exit.The laser spot was focused at normal incidence on an alkali antimonide photocathode by a 0.75 m focal length lens to a size of 150 lm.The gun rapidly accelerates the beam to 3.2 MeV, effectively mitigating transverse phase space degradation caused by space charge.The beam can be accelerated by a dual slot resonantly coupled high shunt impedance linac to 8.2 MeV kinetic energy.A waveguide switch can be used to cut off the RF power to the linac.The gun solenoid in combination with the blue quadrupole triplet are used to minimize the RMS angular spread at the sample plane.A 30 nm thick single crystal gold foil diffraction standard mounted on a 3 mm TEM grid holder was placed in the beamline 3.1 m downstream of the cathode as a sample.A HeNe laser copropagating with the electron beam was used to align the sample and the axes of the objective and eyepiece lenses.Referring to Fig. 3, the green triplet center is located 0.19 m from the sample and the PMQ triplet that serves as the eyepiece to magnify the back focal plane of the objective lens is located 0.81 m from the sample plane.
Start-to-end simulations were conducted for the beamline setup using the particle tracking software GPT. 34GPT considers space charge effects and can use actual field maps for the beamline elements thus incorporating higher-order aberrations.The simulations also factor in the beam acceptance through the PMQ triplet aperture.Diffraction at the sample is modeled by applying diffractive kicks to the simulated phase space beam distribution at the sample plane.Figure 7 illustrates the evolution of the RMS transverse sizes of the beam and kinetic energy up to the last detector plane.
During the experimental run, we implemented the same optimization strategy as in the simulation.Initial diffraction images were captured for reference with the linac switched off at a screen inside the vacuum box, while the beam energy was measured at 3.1 MeV and a representative pattern is shown in Fig. 8(a).Subsequently, the linac was activated and operated at an accelerating phase, raising the beam energy to 8.2 MeV while minimizing energy spread.In Fig. 8  this screen, we further optimized the green triplet to bring the backfocal planes in front of the eyepiece and then inserted the PMQ triplet onto the beam axis.The relative spacings between the PMQs were then optimized to symmetrize the final image, resulting in a strongly magnified diffraction pattern shown in Fig. 8(d).It is immediate to note the large magnification imparted by the eyepiece.It is also clear that only 6 Bragg peaks were propagated through the small PMQ aperture, in agreement with the prediction of the simulation once the actual PMQ stay-clear size was included in the model.In a cylindrically symmetric system, we would expect to observe on the detector screen the lowest order 8 Bragg peaks of the cubic gold lattice, but the astigmatic transport in x and y resulting from the use of quadrupole lenses, and the particular rotation of the sample, causes two of the four 200 Bragg peaks to fail to clear the tight aperture of the PMQ magnet, preventing their transport to the detector screen.By employing a steering magnet at the entrance of the vacuum box, we could direct different portions of the diffraction pattern through the PMQ triplet and display different sections of the reciprocal space.
In analyzing the high-energy UED images, it is instructive to first consider the energy dependence of the scattering cross section.This quantity is crucial for predicting diffraction pattern intensity at higher energy.We can express the differential cross section for elastic scattering from an atom as a function of the atomic number Z and momentum transfer s ¼ 4p sinðh=2Þ=k, where a 0 is the atomic in Bohr radius and is a function that depends on the details of the screened atomic potential.For gold (Z ¼ 79), a i ¼ ½22:864; 3:6914; 1:4886 Å-1 , and A i ¼ ½0:2289; 0:6114; 0:1597. 3,35,36When considering the structure factor of the crystalline lattice, the cross section is heavily weighted by forwarddirected rays at the Bragg angles.In Fig. 9, we show the total cross section and compare it with forward-directed cross sections integrated up to integer multiples of k=a, to represent the intensity of a Bragg peak order.Integration up to a given 1 mrad angle is also shown to exemplify that as the energy increases, the solid angle into which most particles are scattered shrinks.However, the key feature is that cross sections integrated over different annuli, normalized by the momentum factor cb, are constant, therefore implying that the Bragg order diffracted intensities will have little variation when increasing the beam energy from 3.1 to 8.2 MeV.To verify this, we computed the relative intensity of first-order Bragg peaks in relation to the central beam for both low and high energy by summing pixel counts around the respective peaks on the detector screen.On average, the first-order peaks at high (low) energy exhibit an intensity of 5.2% 6 1.0% (5.6% 6 0.9%) compared to the transmitted beam.These values are well within the experimental uncertainty range, and fully consistent with the expectations.
We then varied the spacings of the PMQ triplet eyepiece over the allowed ranges on the flexure stage to observe how the magnification and the q-resolution would change in the x and y directions.The upstream PMQ position could be from 1.5 to 3 mm axially, while the downstream PMQ could be translated from 0 to 3 mm.Note that while axially translating the downstream PMQ across its entire range, the centroid of the main beam remained within a region of radius 500 lm on the detector.Given the focal length of the downstream PMQ is approximately 1.8 cm, and the distance to the detector is 17.5 cm, we can estimate the alignment offset as 50 lm in agreement with the expectations from the pulse-wire alignment data.The results corresponding to the PMQ distances scan while maintaining all the other quads fixed are plotted in Figs.10(a) and 10(b) for the upstream and downstream quad, respectively.The data are color-coded with the position of the other quadrupoles and the results of simulations are overlayed on top of the data points.In agreement with the simulation and linear transport calculations, it is observed that the upstream PMQ position mainly controls the y-angular magnification, while the downstream one has a larger effect on the horizontal one.The most symmetric configuration, yielding an average magnification of 4, is obtained for both quadrupoles at the 3 mm range.

FIG. 9.
A comparison of integrated cross sections for Au in the range 0.01-100 MeV.The red curve shows the total cross section, and the blue and green curves are integrated up to first and second Bragg orders, respectively.In black is an integration over forward-directed angles limited to 1 mrad.
The corresponding q-resolution for each magnification setting can also be estimated from the images by calculating the ratio of the Bragg peak width to their distance from the main beam.We plot in Fig. 10(c) the retrieved horizontal q-resolution along the x-direction as a function of the downstream PMQ position.In agreement with (10), as the magnification gets larger, the q-resolution improves proportionally.The behavior of the data are well captured by a simulation fit where we used the measured spot size at the sample (530 lm) and a fit value of 30 lrad for the rms intrinsic beam angular divergence.A point spread function of 50 lm for the detector screen is also assumed.
Note that the absolute value of q-resolution is affected not only by the beamline optics, but also by factors such as initial beam emittance, energy spread, and point spread function of the screen which were not optimized in these UED experiments.For example, no apertures are positioned upstream of the sample, and the beam emittance was not minimized.For this reason, the data reported is mainly useful to demonstrate the relative resolution improvements enabled by the post-sample magnification optics, rather than an attempt at achieving best absolute resolution.Looking at Eq. (10), even in the case of an optimized optical system, the ultimate q-space resolution is strongly dependent on the beam quality.For example, if the spot size on the sample were to be reduced by a factor of 10, in order to maintain the same q-space resolution, then the emittance of the source would need to be reduced by a factor of 10.

V. PMQ ABERRATIONS
During the experimental run, distinct distortions were observed in the diffraction pattern as the beam traversed the PMQ aperture using an upstream steering magnet.Images were collected at various steering setpoints, enabling the quantification of dominant lens aberration coefficients and a comparison with the effect on the beam dynamics from the higher order multipole moments present in the Radia model of the PMQs.
The Fourier decomposition of transverse fields in Radia reveals in fact a residual octupole moment, originating from the finite number of magnetized sharp wedges used in the Halbach configuration.Given the normal orientation of the PMQs and associated magnetization symmetry, we anticipated the x-component of the magnetic field to have an expansion in terms of sines while the y-component can be written as a sum of cosine harmonics.The Radia field map validates this expectation when we project the extracted field components onto these harmonics Results of the Fourier decomposition at r ¼ 1.4 mm at each axial plane are shown in Fig. 11(a).The dominant term as expected is the quadrupole, but a non-zero b x;3 ¼ b y;3 ¼ b octupole moment is found.The non-linear fields lead to third-order ray equations and a third-order transport map where U 1111 ¼ 0:25 mm À2 , U 1133 ¼ 2:20 mm À2 , U 3333 ¼ À11:80 mm À2 , and U 3311 ¼ À1:18 mm À2 are the third-order transport coefficients that can be evaluated using Green's function approach as detailed in the Appendix.Since the beam is collimated at the objective back focal plane, terms dependent on the angles at the eyepiece location are less prominent.All the ten unique third-order aberration coefficients for both planes are listed in the Appendix, Table II.In Fig. 11(b), the positions of the Bragg peaks at each steering setpoint, as measured on the detector, are superimposed with the results from the transport, including third-order components.The figure illustrates how a grid of axial rays is distorted, aligning qualitatively and quantitatively with the observed distortions of the Bragg peaks.As these Bragg peaks are steered horizontally across the PMQ entrance, they trace out a path on the detector screen (identified by the dash lines in Fig. 11(b) that follows the pincushion distortion arising from U 3311 , confirming the analysis of the PMQ field map.While it is straightforward to take into account these aberrations in postprocessing, there are different strategies to minimize them.One option is to optimize the PMQ design by increasing the aperture size reducing the sampling of the higher-order moments in the PMQ magnetic field.This would also mitigate the clipping of the Bragg peaks and maximize the reciprocal space field of view.Alternatively, the defocus of the imaging stage can be optimized to mitigate the impact of the thirdorder terms on the resolution-an approach commonly used to deal with spherical aberration in TEMs. 37,38However, this method alone does not fully compensate the effects of non-linearities in the transport; in order to achieve full aberration correction, higher-order optics would be needed.

VI. CONCLUSION AND OUTLOOK
In conclusion, we have successfully implemented a compact optical system based on permanent magnet quadrupole (PMQ) optics for ultrafast electron diffraction.The use of strong gradient PMQ focusing enables achieving high angular magnifications within a small footprint.Precise alignment and motion control of the PMQ positions contribute to the flexibility and tunability of the optical system.Drawbacks of the high focusing gradients include the limited beam acceptance due to the small aperture of the optics and the distortions and aberrations resulting from the higher order field components.Still, the strong lenses provide magnification factors as large as 8 and improved q-resolution, which might be critical for some systems to observe dynamics at small scattering vectors (i.e., long spatial scales).
Our approach diverges from traditional methods in the diffraction community, where post-sample optics are rarely employed to observe diffraction patterns.Instead of allowing the beam to just diffract and drift to the detector, our system's capabilities become  g y hS 3 y ds particularly useful at higher energy levels.This is crucial, significantly where diminishing Bragg angles pose challenges in achieving sufficient separation within a short distance from the beam intrinsic angular spread.The use of optics becomes critical to overcome these challenges and obtain a clear diffraction pattern at 8.2 MeV kinetic energy, nearly twice the energy of other relativistic UED beamlines to date.Higher beam kinetic energy is expected to enhance diffraction resolution because of shorter electron wavelengths, smaller geometric emittance, and deeper sample penetration, providing wider opportunities to extract information from the sample.Additionally, higher beam energies further suppress space charge effects and allow for more sophisticated phase space manipulations, thus opening the opportunity for shorter beams and smaller spot sizes in future UED instrumentation.

FIG. 1 .
FIG. 1. Ray diagram showing an angular magnification telescope.Initially, parallel rays converge to the same position at the detector with a magnified offset compared to the objective's back focal plane.

FIG. 3 .
FIG. 3. (a) The cosine-like principal ray is depicted traversing an optimized optics setup where the green quadrupole triplet positions back focal planes just in front of the PMQ triplet.The PMQ triplet then forms images on the downstream detector at z ¼ 1:6 m.(b) The sine-like principal ray is magnified at the detector.(c) An optimization scan for angular magnification is conducted for a nearby screen, with symmetric back focal planes set at varied positions while the PMQ triplet maintains imaging at z ¼ 1:02 m.(d) Back focal planes are separated using the green quadrupole triplet, and the spacings of the PMQ triplet are optimized to restore symmetric imaging at z ¼ 1:02 m.

FIG. 4 .
FIG. 4. (a) Technical drawing of the PMQs as mounted on the flexure stage.(b) Setup of the pulsed-wire alignment technique.

FIG. 5 .
FIG. 5. (a) Calibration of oscilloscope signal of central peak with the PMQs' displacement.(b) Oscilloscope signal of the central peak when the first and third PMQs are moved.(c) Signal with different transverse offset.The bottom axis is the signal timing, and the top axis is the corresponding distance.(d) Retrieved PMQ field from pulsed-wire signal.
FIG. 6. Pegasus beamline technical drawings showing the main elements in the experimental setup.

FIG. 7 .
FIG. 7. Results from self-consistent start-to-end GPT simulation of the Pegasus beamline including RF gun, linac and space charge effects.The rms horizontal (blue solid) and vertical (dashed) envelopes and the kinetic energy (red) are shown up to the detector.

FIG. 8 .
FIG. 8. Single-shot diffraction patterns captured at the z ¼ 1.02 m fluorescent screen.For (a) the linac is turned off and the kinetic energy is 3.1 MeV.The green quadrupole triplet is tuned to focus on the detector.(b)-(d) are acquired with the linac turned on and the beam energy at 8.2 MeV, (b) is obtained without focusing, (c) with focusing, and (d) with magnification.

FIG. 10 .
FIG. 10.Scan results where spacing of (a) upstream PMQ spacing and (b) downstream PMQ spacing is decreased from 3 mm.(c) Horizontal Q-resolution during the scan.

FIG. 11 .
FIG. 11.(a) Quadrupole and octupole Fourier components and their axial dependence are shown for the 3 and 6 mm PMQs.(b) Overlay of horizontally steered diffraction beamlet centroid positions, as measured on the detector, with a 3rd-order aberrated image of an initially square grid of rays.The initial positions of the square grid fill the expected region of the first-order Bragg peaks at the objective back focal plane.

TABLE I .
PMQ parameters.